			// index.js
			// 获取应用实例
			const app = getApp()

			Page({

			/**
				* 页面的初始数据
				*/
			data: {
				queryInfo:{
					 pageNumber:1,
					 pageSize:7
				},
				hasMoreData:true,
				sportInfo:[],
				imageUrls:{},
				bannerUrls: ['https://gw.alicdn.com/tfs/TB1MEhHoN6I8KJjy0FgXXXXzVXa-750-234.jpg_760x760q75.jpg_.webp', 'https://gw.alicdn.com/imgextra/i3/0/TB2O9BaoMLD8KJjSszeXXaGRpXa_!!0-travel.jpg_760x760q75.jpg_.webp', 'https://gw.alicdn.com/tfs/TB1WGnPmBTH8KJjy0FiXXcRsXXa-750-234.jpg_760x760q75.jpg_.webp','https://gw.alicdn.com/tfs/TB1vX7qoC_I8KJjy0FoXXaFnVXa-750-234.jpg_760x760q75.jpg_.webp'],
				types:[
					{
					  imgUrl:'https://gw.alicdn.com/tfs/TB1lw9HfgoQMeJjy0FpXXcTxpXa-225-183.png',
					  title:'机票'
					}, {
					  imgUrl: 'https://gw.alicdn.com/tfs/TB1KsxcbjihSKJjy0FiXXcuiFXa-225-183.png',
					  title: '酒店客栈'
					}, {
					  imgUrl: 'https://gw.alicdn.com/tfs/TB1YxNfbjihSKJjy0FlXXadEXXa-225-183.png',
					  title: '火车票'
					}, {
					  imgUrl: 'https://gw.alicdn.com/tfs/TB1A0hdbaagSKJjy0FhXXcrbFXa-225-183.png',
					  title: '汽车票'
					}, {
					  imgUrl: 'https://gw.alicdn.com/tfs/TB1G_E.a6ihSKJjy0FeXXbJtpXa-227-183.png',
					  title: '用车'
					}, {
					  imgUrl: 'https://gw.alicdn.com/tfs/TB1YhCPfgMPMeJjy1XcXXXpppXa-225-183.png',
					  title: '旅游线路'
					}, {
					  imgUrl: 'https://gw.alicdn.com/tfs/TB1NBJibaagSKJjy0FcXXcZeVXa-225-183.png',
					  title: '周边游'
					}, {
					  imgUrl: 'https://gw.alicdn.com/tfs/TB1wtlcbjihSKJjy0FfXXbGzFXa-225-183.png',
					  title: '门票'
					}, {
					  imgUrl: 'https://gw.alicdn.com/tfs/TB13_9IfgoQMeJjy0FpXXcTxpXa-225-183.png',
					  title: '领里程'
					}, {
					  imgUrl: 'https://gw.alicdn.com/tfs/TB1rv1IfgMPMeJjy1XbXXcwxVXa-227-183.png',
					  title: '全部'
					}
					],
					obSupermarket: ['国际机票', '签证', '国际酒店', '国际租车', '接送机', '境外上网', '景点票务', '当地玩乐'],
      headlines:[{
        tips1:'精选',
        title1:'海南五大小众海湾，景色绝美还不要门票',
        tips2:'超赞',
        title2:'这里的美景随手一拍都是大片'
      }, {
        tips1: '精选',
        title1: '2月最佳旅行地出炉！用一场旅行犒劳努力的自己',
        tips2: '超赞',
        title2: '告诉你五天怎么玩遍贵州经典的景点'
      }],
      station:[
        {
          name:'香港',
          img:'https://gw.alicdn.com/imgextra/i2/6000000007922/TB2pD1Sae2CK1JjSZFIXXa3OpXa_!!0-travel.jpg_400x400q75.jpg_.webp',
          intro:'初赏维港夜景，重返梦幻童年'
        }, {
          name: '日本',
          img: 'https://gw.alicdn.com/imgextra/i4/6000000006424/TB2OOhnXBOBJuJjy1XdXXXIXVXa_!!2-travel.png_400x400q75.jpg_.webp',
          intro: '第一次的邮轮之旅，去赛琳娜号'
        }, {
          name: '泰国',
          img: 'https://gw.alicdn.com/imgextra/i2/6000000004125/TB2XILLXhHBK1JjSZFkXXbg9VXa_!!0-travel.jpg_400x400q75.jpg_.webp',
          intro: '普吉亲子游，收获中泰友谊'
        }
      ],
      randomPlace:[
        {
          img:'https://gw.alicdn.com/tips/TB24CFwbShlpuFjSspkXXa1ApXa_!!689896364.jpg_400x400q75.jpg_.webp',
          name:'爸妈放心游',
          intro:'品质送爸妈'
        }, {
          img: 'https://gw.alicdn.com/tips/TB2KPh1sXXXXXamXXXXXXXXXXXX_!!490728022.jpg_400x400q75.jpg_.webp',
          name: '江浙沪包游',
          intro: '江南水乡荡悠悠'
        }, {
          img: 'https://gw.alicdn.com/tips/i6/TB1ArlNoL2H8KJjy1zkT3Br7pXa_044157.jpg_400x400q75.jpg_.webp',
          name: '全球游园汇',
          intro: '有些地方没打卡'
        }, {
          img: 'https://gw.alicdn.com/tips/T2aA4EXllaXXXXXXXX_!!503505992.jpg_400x400q75.jpg_.webp',
          name: '潜水老司机',
          intro: '旱鸭子也能潜水'
        }, {
          img: 'https://gw.alicdn.com/i2/T1PSH_FdNcXXXXXXXX_!!0-item_pic.jpg_400x400q75.jpg_.webp',
          name: '泡泡温泉',
          intro: '泡泡温泉泡泡你'
        }, {
          img: 'https://gw.alicdn.com/imgextra/i3/6000000004210/TB2suRdao3iyKJjSspnXXXbIVXa_!!0-travel.jpg_400x400q75.jpg_.webp',
          name: '天堂海岛游',
          intro: '享受马尔代夫自然美景'
        }
      ],
      hotPlace:[
        {
          name: '巴厘岛',
          img: 'https://gw.alicdn.com/imgextra/i3/6000000004600/TB2CtiIuhRDOuFjSZFzXXcIipXa_!!0-travel.jpg_760x760q50.jpg_.webp',
          num: '46.7'
        }, {
          name: '武汉',
          img: 'https://gw.alicdn.com/imgextra/i3/6000000001348/TB2_ENirb0kpuFjy0FjXXcBbVXa_!!2-travel.png_540x540q50.jpg_.webp',
          num: '84.3'
        }, {
          name: '越南',
          img: 'https://gw.alicdn.com/imgextra/i2/6000000006173/TB2_TJbvYtlpuFjSspfXXXLUpXa_!!0-travel.jpg_760x760q50.jpg_.webp',
          num: '53'
        }, {
          name: '上海',
          img: 'https://gw.alicdn.com/imgextra/i4/6000000006745/TB235SueLNZWeJjSZFpXXXjBFXa_!!0-travel.jpg_760x760q50.jpg_.webp',
          num: '78.9'
        }
      ],
			},

            findPage(message){
				wx.showNavigationBarLoading();
				//显示 loading 提示框
				wx.showToast({
					title: '加载资讯中',
					icon:'loading',
				});
				 wx.request({
					 url: 'http://127.0.0.1:8088/sport/findPage',
					 data:this.data.queryInfo,
					 method:'POST',
					 header:{
						'Authorization':wx.getStorageSync('token')	
					 },
					 success:(res)=>{
						    
							 let temp=this.data.sportInfo;
							 let  result=res.data.rows;
							 if(result.length>0){
								  if(this.data.queryInfo.pageNumber==1){
										 temp=[];
									}
									if(result.length<this.data.queryInfo.pageSize){
										  this.setData({
													sportInfo: temp.concat(result),
													hasMoreData:false
											})
									}else{
										    this.setData({
													 sportInfo:temp.concat(result),
													 hasMoreData:true,
													 queryInfo:{
															pageNumber :this.data.queryInfo.pageNumber+1,
															pageSize:5
													 }
												})
									}
							 }else{
								   this.setData({
										   hasMoreData:false
									 });
									 wx.showNavigationBarLoading();
									 wx.showLoading({
										 title: '没有了~~~~',
									 });
									 setTimeout(() => {
											wx.hideNavigationBarLoading(),
											wx.hideLoading()
									 }, 1000);
							 }
							 wx.hideNavigationBarLoading();
							 wx.hideLoading();
					 },
						fail :(err)=>{
							console.log(err)
						}
				 })
			},

			findImage(message){
                 console.log(111111)
			},

			/**
				* 生命周期函数--监听页面加载
				*/
			onLoad: function (options) {
				 this.findPage();
				 this.findImage()
			},

			/**
			 * 详情
			 * @param {*} id 
			 */
			toDetails(event){
				let id=event.target.dataset.id;
				console.log(id);
           wx.navigateTo({
						 url: `/pages/index/details/details?id=${event.target.dataset.id}`,
					 })
			},

			/**
				* 生命周期函数--监听页面初次渲染完成
				*/
			onReady: function () {
				
			},

			/**
				* 生命周期函数--监听页面显示
				*/
			onShow: function () {	 
               this.getTabBar().init();
			},

			/**
				* 生命周期函数--监听页面隐藏
				*/
			onHide: function () {
				
			},

			/**
				* 生命周期函数--监听页面卸载
				*/
			onUnload: function (options) {
				  this.findPage('努力加载中....')
			},

			/**
				* 页面相关事件处理函数--监听用户下拉动作
				*/
			onPullDownRefresh: function () {
         this.data.queryInfo.pageNumber=1;
				 this.findPage("拼命加载中...");
			},

			/**
				* 页面上拉触底事件的处理函数
				*/
			onReachBottom: function () {
	         if(this.data.hasMoreData){
						   this.findPage('加载更多数据...');
					 }
			},

			/**
				* 用户点击右上角分享
				*/
			onShareAppMessage: function () {
				
			}
			})